import java.util.ArrayList;

public class Token implements Comparable<Token>{
	private String token;
	private int count = 1;
	
	private ArrayList<Integer> lineNumList = new ArrayList<Integer>(); 
	
	Token(String t){
		token = t;
	}
	
	Token(String t,int line){
		token = t;
		lineNumList.add(line);
	}
	
	public String getToken() {return token;}
	public Integer getLine() {return lineNumList.get(0);}
	public String getLineAsString() {return lineNumList.toString();}
	public int getCount(){return count;}
	
	
	public void incrementCount(){count++;}
	
	public void setToken(String t) {token = t;}
	public void addLineNum(int l){lineNumList.add(l);}
	
	public int Compare(Token lhs, Token rhs)
	{
		if (lhs.getToken().equals(rhs.getToken()) )
			return 1;
		else
			return 0;
	}

  public int CompareTo(Token rhs) {return Compare(this, rhs);}

	public int compareTo(Token o) {return this.getToken().compareTo(o.getToken());}

}